import Vue from 'vue'
import Router from 'vue-router'
Vue.use(Router)

export const constantRouterMap = [
  {
    path: '/',
    redirect: '/login',
    hidden: true 
  },
  {
    path: '/home',
    name: 'home',
    component: resolve => require(['../components/home'], resolve),
    hidden: true ,
    redirect:'/home/basicInfo',
    children:[
      {
        path:'basicInfo',
        name: 'basicInfo',
        component: resolve => require(['../views/basicInfo'], resolve)
      },
      {
        path:'customerInfo',
        name: 'customerInfo',
        component: resolve => require(['../views/customerInfo'], resolve)
      },
      {
        path:'enterpriseProBinding',
        name: 'enterpriseProBinding',
        component: resolve => require(['../views/enterpriseProBinding'], resolve)
      },
      {
        path:'responsibilityCombination',
        name: 'responsibilityCombination',
        component: resolve => require(['../views/responsibilityCombination'], resolve)
      },
      {
        path:'otherBenefits',
        name: 'otherBenefits',
        component: resolve => require(['../views/otherBenefits'], resolve)
      }
    ]
  },
  {
    path: '/login',
    name: 'Login',
    component: resolve => require(['../views/login'], resolve),
    hidden: true 
  },
  {
    path: '/404', 
    component: resolve => require(['../components/notfind'], resolve), 
    hidden: true 
  },
  { 
    path: '*', 
    redirect: '/404', 
    hidden: true 
  }
]

export default new Router({
  // mode:'history',
  scrollBehavior: () => ({
    y: 0
  }),
  routes: constantRouterMap
})
